﻿using AnesSystem.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls
{
    /// <summary>
    /// AnesRecordItemCtrl.xaml 的交互逻辑
    /// </summary>
    public partial class AnesRecordItemCtrl : BaseTableControl
    {

        #region Variables
        
        #endregion

        #region Constructor
        public AnesRecordItemCtrl()
        {
            InitializeComponent();
            _realTimeItemCtrl.ParameterBtnClicked += _realTimeItemCtrl_ParameterBtnClicked;
        }

        #endregion

        #region Properties

        #endregion

        #region 依赖属性

        #endregion

        #region Event

        #endregion

        #region Private Methods

        #endregion

        #region Public/Protected Methods

        #endregion

        #region EventHandlers

        private void _realTimeItemCtrl_ParameterBtnClicked(object sender, EventArgs e)
        {
            try
            {
                if ((this.DataContext as AnesRecordItemCtrlViewModel).RealTimeSignShowCtrlViewModel.VitalCtrlList == null || !((this.DataContext as AnesRecordItemCtrlViewModel).RealTimeSignShowCtrlViewModel.VitalCtrlList.Count >0))
                {
                    (this.DataContext as AnesRecordItemCtrlViewModel).RealTimeSignShowCtrlViewModel.InitialVitalCtrlList();
                }
                RealTimeDialogCtrl.Instance._realtime.DataContext = (this.DataContext as AnesRecordItemCtrlViewModel).RealTimeSignShowCtrlViewModel;
                DrugAndEventWindow.Instance.CusContent = RealTimeDialogCtrl.Instance;
                DrugAndEventWindow.Instance.Title = "体征参数";
                DrugAndEventWindow.Instance.ShowDialog();
            }
            catch (Exception ex)
            {

                Common.LogHelper.Error(this.GetType(), ex);
            }
        }

        #endregion
        
    }
}
